package com.vit.bb;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.XYEdges;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.BackgroundFactory;
import net.rim.device.api.ui.decor.BorderFactory;

/**
 * 
 */

/**
 * @author crodriguez
 *
 */
public class VitScreen extends MainScreen{

	
	protected VerticalFieldManager _vfManager;
	
	protected HorizontalFieldManager _hfManager;
	
	protected HorizontalFieldManager _hfBanner;
	
	
	public VitScreen(){
		this.getMainManager().setBackground(
				BackgroundFactory.createLinearGradientBackground(0x0099CCFF,
				0x0099CCFF,0x00336699,0x00336699)
				);
		
		Bitmap borderBitmap = Bitmap.getBitmapResource("rounded.png");
		_vfManager = new VerticalFieldManager();
		_vfManager.setBorder(BorderFactory.createBitmapBorder(new XYEdges(12,12,12,12), borderBitmap));
		
		_hfManager  = new HorizontalFieldManager();
		_hfManager.setBorder(BorderFactory.createBitmapBorder(new XYEdges(12,12,12,12), borderBitmap));
		
		
		Bitmap banner = Bitmap.getBitmapResource("mosaic_banner.png");
		int scaledX = 193;
	    int scaledY = 58;
	    Bitmap bitmapScaled = new Bitmap(scaledX, scaledY);
	    banner.scaleInto(bitmapScaled , Bitmap.FILTER_LANCZOS);                       
	    banner.scaleInto(bitmapScaled , Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FILL);                       
	    BitmapField bitmapFieldScaled2 = new BitmapField(bitmapScaled , Field.FOCUSABLE);
		
		
		_hfBanner  = new HorizontalFieldManager();
		_hfBanner.setBorder(BorderFactory.createBitmapBorder(new XYEdges(12,12,12,12), borderBitmap));
		_hfBanner.add(bitmapFieldScaled2);
		
		
		
		
		/*
		StandardTitleBar myTitleBar = new StandardTitleBar()
        	.addIcon("icon.png")        
        	.addNotifications()
        	.addSignalIndicator();
		myTitleBar.setPropertyValue(StandardTitleBar.PROPERTY_BATTERY_VISIBILITY,
        StandardTitleBar.BATTERY_VISIBLE_LOW_OR_CHARGING);
		*/
		//setTitleBar(myTitleBar);
		
	}
	
	
}//class
